console.log($event);

const { panel_config  = {} } = this.widgetObj._option;
const queryManage = this.pageObj.getApiWidgetByAliasName('queryManage')?.widgetObj;
const type = this.pageObj.getVariables().find(v => v.name === 'panelType')?.value || 0;
const process = this.pageObj.getVariables().find(v => v.name === 'whetherProcess')?.value || 0;
const _form = this.getApiPage().retrievePlugin('base-forms');
const searchText = _form.getFormData('form_12')?.search;

if($event.show && $event.id !== 'all' ) {
  const params = {
    pageNum: 1,
    pageSize: 10,
    eventTitle: searchText,
    drillName: searchText,
    whetherProcess: process
  };
  const title = $event.title;
  if (+type === 1) {
    params.occurrencePlace = title
  } else if (+type === 2) {
    params.eventType = title
  } else if (+type === 3) {
    params.eventGrade = title
  } else {
    params.occurrencePlace = $event.title
  }

  queryManage.queryDrillList(params).then(({ success, result }) => {
    console.log({ success, result });
    if(success) {
      const { page = {} } = panel_config;
      const option = {
        dataSource: result,
        total: result.totalWarning,
        page: { ...page, current: 1 }
      };

      this.widgetObj.tree.pannelRerender(title, option)
    }
  })
}
